package org.ccams.util;

import java.util.Map;
import java.util.HashMap;
import java.util.List;

public class ConvertUtil {
	@SuppressWarnings("unchecked")
	public static Map<String, Object> generate(List list) {

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("totalProperty", list.size());
		map.put("root", list);
		return map;
	}

	public static Map<String, Object> javabean2json(Object object) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("success", true);
		map.put("data", object);
		return map;
	}

	@SuppressWarnings("unchecked")
	public static Map<String, Object> objectcollect2json(List list, int count) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("totalProperty", count);
		map.put("root", list);
		return map;
	}
}
